<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <div>{{msg}}</div>
        <div>{{msg}}</div>
        <button v-on:click='changeMsg(123)'>修改成123</button>
        <button v-on:click='changeMsg("abc")'>修改成abc</button>
        <!-- abc是字符串，必须引起来，或者使用``反引号 -->
        <button v-on:click='changeMsg(666)'>修改成666</button>
    </div>
    <script src="js/vue.js"></script>
    <script>
        new Vue ({
            el: '#app',
            data: {
                msg: '我是一行内容'
            },
           methods: {
               changeMsg(name) {
                this.msg=name;
               }
           }
        })
    </script>
</body>
</html>